package com.ygqh.baby.shiro.utils;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.ygqh.baby.po.AdminUser;
import com.ygqh.baby.po.YgUser;

public class SessionUtil {
	public static YgUser getCurrentUser() {
		Subject subject = SecurityUtils.getSubject();
		if(subject.isAuthenticated()) {
			YgUser user  = (YgUser) subject.getPrincipal();
			return user;
		}
		return null;
	}
}
